<%-- 
    Document   : w_revenueReport
    Created on : Dec 16, 2013, 11:19:11 AM
    Author     : Trang
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="model.Role"%>
<%@page import="model.Staff"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib uri="http://displaytag.sf.net" prefix="display" %>

<!DOCTYPE html>
<%
    Staff staff = (Staff) session.getAttribute("staff");

    if (staff == null) {
        response.sendRedirect(request.getContextPath() + "/Administration");
    } else {
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Revenue Report</title>
        <link href="<%= request.getContextPath()%>/css/style_for_page.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_for_menu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_addtion.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_for_warehousing.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/adMenu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/tHeaderFooter.css" rel="stylesheet" type="text/css"/>

        <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
        <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
        <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
        <link rel="stylesheet" href="/resources/demos/style.css" />
        <script>
            $(document).ready(function() {
                $('#tbTimeRange').hide();
            });
            $(function() {
                $('#start').datepicker();
                $('#end').datepicker();
            });
            function Check()
            {
               
              var selectedEffect = $("#selectedTime").val();
               //var selectedEffect = document.getElementById("selectedTime").getAttribute("timemode");
                 //alert(selectedEffect+"trang");
                if (selectedEffect === "Customer Range")
                {
                     //alert("Klj");
                    //document.getElementById("tbTimeRange").style.visibility.visible;
                    $("#tbTimeRange").show();
                }
                else
                    {
                       // alert("aaa");
                     $('#tbTimeRange').hide();
                    }
            }
            $("#button").click(function() {
                Check();
                //return false;
            });
        </script>
    </head>
    <body style="background-color: lightsteelblue;">
        <% int i = 0;%>
        <div class="headerbg">
            <div class="header"> 
                <%@include file="/include/mHeader.jsp" %>
            </div>
            <div class="adContent">
                <div class="adMenu">
                    <%@include file="/include/mMenu.jsp" %>
                </div>
            </div>
        </div>
        <div class="divcontent">
            <div class="contentbg">
                <div class="content">
                    <div style="width: 1024px; color: white; background-color: #610B0B; float:left;margin:auto;">
                        <h3 style="margin-left: 10px;">Revenue Report Display As...</h3>
                    </div>
                    <div id="errorMessage">
                        <div class="registerbg" >
                            <div class="registerForm" style="border-right: 1px #610B0B dashed;min-height: 400px;">
                                <s:form cssStyle="float:left" action="getrevenue" target="_blank" namespace="/Administration/Report" theme="simple">
                                    <table theme="simple" style="text-align: left; margin-left: 10px;">
                                        <tr>
                                            <td colspan="2">
                                                <h3>Time Mode</h3>
                                            </td>    
                                        </tr>
                                        <tr>
                                            <td>
                                                <p><s:select theme="simple" id="selectedTime" name="timemode" cssStyle="width: 200px; " 
                                                          list="{'Current Day','Current Month', 'Current Year','Customer Range'}" onchange="Check();"/>
                                            </td>
                                        </tr>
                                    </table>
                                    <table theme="simple" style="text-align: left; margin-left: 10px;" id="tbTimeRange" >
                                        <tr>
                                            <td>
                                                <h4 style="color: red;">Please select customer range:</h4>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <p ><b><i>From: </i></b><s:textfield name="startDate" theme="simple" size="30" id="start" /></p>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <p><b><i>To: </i></b><s:textfield name="endDate" theme="simple" label="To" size="30"  id="end"/></p>
                                            </td>
                                        </tr>
                                    </table>
                                    <table theme="simple" style="text-align: left;margin-left: 10px;">        

                                        <tr>
                                            <td colspan="2">
                                                <h3>Display Mode</h3>
                                            </td>    
                                        </tr>
                                        <tr>
                                            <td>
                                                <p><s:select theme="simple"  name="displayMode" cssStyle="width: 200px; " list="{'Display By Customer', 'Display By Product'}" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <s:reset value="Reset" cssStyle="width: 96px" theme="simple" />
                                            </td>
                                            <td>
                                                <s:submit value="Create Report" cssStyle="width: 96px; margin-left: 132px" theme="simple" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2"><s:actionerror /></td>
                                        </tr>
                                    </table>
                                </s:form>
                            </div>
                            <div class="registerTerms">
                                <h1>Create Report Notes</h1>
                                </br>
                                <p>- Start Date cannot empty</p>
                                <p>- End Date cannot empty</p>
                                <p>- Start Date must be smaller than End Date.</p>
                                <br>   
                            </div>
                        </div>
                    </div>
                    </br>
                </div>
            </div>
            <div class="content">   
            </div>
            <footer>
                <div id="footer">
                    <%@include file="/include/iFooter.jsp" %>
                </div>    
            </footer>
    </body>
</html>
<%
    }
%>


